package com.tbit.uqbike.constant;

import com.tbit.uqbike.constant.enums.AccountDayStatEnum;

import java.util.*;

/**
 * 通用常量信息
 *
 * @author jing
 */
public class Constants {
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";

    /**
     * 用户名称
     */
    public static final String JWT_USERNAME = "sub";

    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";

    /**
     * 用户权限
     */
    public static final String JWT_AUTHORITIES = "authorities";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    public static final String SYS_MODEL_KEY = "sys_model:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * 用户标记故障N天内连续多少次
     */
    public static final String USER_SIGN_FAULT_DAY = "user_sign_fault_day";
    /**
     * 用户标记故障多少天内连续N次
     */
    public static final String USER_SIGN_FAULT_COUNT = "user_sign_fault_count";

    /**
     * 区域配置缓存
     */
    public static final String ACCOUNTCONFIG_KEY_PREFIX = "ACCOUNTCONFIGEXT#";

    //车辆列表搜索类型集合
    public static final Map<String,Integer> machineSearchTypeMap = new HashMap<String,Integer>(){{
        put("车辆编号",1);
        put("设备编号",2);
        put("电池编码",3);
        put("车架号",4);
        put("车牌号",5);
        put("电机号",6);
        put("头盔mac地址",7);
    }};

    /**
     * 订单收益环比
     * */
    public static final String CYCLING_INCOME_PERCENT = AccountDayStatEnum.CYCLING_INCOME.getFieldName() + "_percent";

    /**
     * 订单数
     * */
    public static final String CYCLING_ORDER = "cycling_order";

    /**
     * 订单数环比
     * */
    public static final String CYCLING_ORDER_PERCENT = "cycling_order_percent";

    /**
     * 车均收益环比
     * */
    public static final String AVERAGE_VEHICLE_INCOME_PERCENT = AccountDayStatEnum.AVERAGE_VEHICLE_INCOME.getFieldName() + "_percent";

    /**
     * 车均订单数环比
     * */
    public static final String NUMBER_OF_ORDERS_PER_VEHICLE_PERCENT = AccountDayStatEnum.NUMBER_OF_ORDERS_PER_VEHICLE.getFieldName() + "_percent";

    /**
     * 单均时长环比
     * */
    public static final String MACHINE_RIDING_TIME_PERCENT = AccountDayStatEnum.MACHINE_RIDING_TIME.getFieldName() + "_percent";

    /**
     * 单均里程环比
     * */
    public static final String ACCUMULATED_MILEAGE_PERCENT = AccountDayStatEnum.ACCUMULATED_MILEAGE.getFieldName() + "_percent";

    /**
     * 返回数据类型是金额
     * */
    public static final Integer GET_RETURN_SUM_TOTAL_TYPE = 0;
    /**
     * 返回数据类型是次数
     * */
    public static final Integer GET_RETURN_CNT_TOTAL_TYPE = 1;

    //系统默认角色的账户id(accountId)
    public static final Integer SYSTEM_DEFAULT_ROLE_ACCOUNT_ID = 0;

    /**
     * 品牌角色的等级
     * */
    public static final Integer BRAND_ROLE_LEVEL = 1;

    //有效
    public static final Integer VALID = 1;
    //无效
    public static final Integer NO_VALID = 0;









}
